Optimal. Leaf size=151 \[ -\frac {a \log (\cos (c+d x))}{d}+\frac {a \sec (c+d x)}{d}-\frac {2 a \sec ^2(c+d x)}{d}-\frac {4 a \sec ^3(c+d x)}{3 d}+\frac {3 a \sec ^4(c+d x)}{2 d}+\frac {6 a \sec ^5(c+d x)}{5 d}-\frac {2 a \sec ^6(c+d x)}{3 d}-\frac {4 a \sec ^7(c+d x)}{7 d}+\frac {a \sec ^8(c+d x)}{8 d}+\frac {a \sec ^9(c+d x)}{9 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 151, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3964, 90}
\begin {gather*} \frac {a \sec ^9(c+d x)}{9 d}+\frac {a \sec ^8(c+d x)}{8 d}-\frac {4 a \sec ^7(c+d x)}{7 d}-\frac {2 a \sec ^6(c+d x)}{3 d}+\frac {6 a \sec ^5(c+d x)}{5 d}+\frac {3 a \sec ^4(c+d x)}{2 d}-\frac {4 a \sec ^3(c+d x)}{3 d}-\frac {2 a \sec ^2(c+d x)}{d}+\frac {a \sec (c+d x)}{d}-\frac {a \log (\cos (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 3964
Rubi steps
\begin {align*} \int (a+a \sec (c+d x)) \tan ^9(c+d x) \, dx &=-\frac {\text {Subst}\left (\int \frac {(a-a x)^4 (a+a x)^5}{x^{10}} \, dx,x,\cos (c+d x)\right )}{a^8 d}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {a^9}{x^{10}}+\frac {a^9}{x^9}-\frac {4 a^9}{x^8}-\frac {4 a^9}{x^7}+\frac {6 a^9}{x^6}+\frac {6 a^9}{x^5}-\frac {4 a^9}{x^4}-\frac {4 a^9}{x^3}+\frac {a^9}{x^2}+\frac {a^9}{x}\right ) \, dx,x,\cos (c+d x)\right )}{a^8 d}\\ &=-\frac {a \log (\cos (c+d x))}{d}+\frac {a \sec (c+d x)}{d}-\frac {2 a \sec ^2(c+d x)}{d}-\frac {4 a \sec ^3(c+d x)}{3 d}+\frac {3 a \sec ^4(c+d x)}{2 d}+\frac {6 a \sec ^5(c+d x)}{5 d}-\frac {2 a \sec ^6(c+d x)}{3 d}-\frac {4 a \sec ^7(c+d x)}{7 d}+\frac {a \sec ^8(c+d x)}{8 d}+\frac {a \sec ^9(c+d x)}{9 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.46, size = 134, normalized size = 0.89 \begin {gather*} \frac {a \sec (c+d x)}{d}-\frac {4 a \sec ^3(c+d x)}{3 d}+\frac {6 a \sec ^5(c+d x)}{5 d}-\frac {4 a \sec ^7(c+d x)}{7 d}+\frac {a \sec ^9(c+d x)}{9 d}-\frac {a \left (24 \log (\cos (c+d x))+12 \tan ^2(c+d x)-6 \tan ^4(c+d x)+4 \tan ^6(c+d x)-3 \tan ^8(c+d x)\right )}{24 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 199, normalized size = 1.32
method | result | size |
derivativedivides | \(\frac {a \left (\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )^{9}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{7}}+\frac {\sin ^{10}\left (d x +c \right )}{105 \cos \left (d x +c \right )^{5}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{3}}+\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )}+\frac {\left (\frac {128}{35}+\sin ^{8}\left (d x +c \right )+\frac {8 \left (\sin ^{6}\left (d x +c \right )\right )}{7}+\frac {48 \left (\sin ^{4}\left (d x +c \right )\right )}{35}+\frac {64 \left (\sin ^{2}\left (d x +c \right )\right )}{35}\right ) \cos \left (d x +c \right )}{9}\right )+a \left (\frac {\left (\tan ^{8}\left (d x +c \right )\right )}{8}-\frac {\left (\tan ^{6}\left (d x +c \right )\right )}{6}+\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(199\) |
default | \(\frac {a \left (\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )^{9}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{7}}+\frac {\sin ^{10}\left (d x +c \right )}{105 \cos \left (d x +c \right )^{5}}-\frac {\sin ^{10}\left (d x +c \right )}{63 \cos \left (d x +c \right )^{3}}+\frac {\sin ^{10}\left (d x +c \right )}{9 \cos \left (d x +c \right )}+\frac {\left (\frac {128}{35}+\sin ^{8}\left (d x +c \right )+\frac {8 \left (\sin ^{6}\left (d x +c \right )\right )}{7}+\frac {48 \left (\sin ^{4}\left (d x +c \right )\right )}{35}+\frac {64 \left (\sin ^{2}\left (d x +c \right )\right )}{35}\right ) \cos \left (d x +c \right )}{9}\right )+a \left (\frac {\left (\tan ^{8}\left (d x +c \right )\right )}{8}-\frac {\left (\tan ^{6}\left (d x +c \right )\right )}{6}+\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(199\) |
risch | \(i a x +\frac {2 i a c}{d}+\frac {2 a \left (315 \,{\mathrm e}^{17 i \left (d x +c \right )}-1260 \,{\mathrm e}^{16 i \left (d x +c \right )}+840 \,{\mathrm e}^{15 i \left (d x +c \right )}-5040 \,{\mathrm e}^{14 i \left (d x +c \right )}+4788 \,{\mathrm e}^{13 i \left (d x +c \right )}-14280 \,{\mathrm e}^{12 i \left (d x +c \right )}+5112 \,{\mathrm e}^{11 i \left (d x +c \right )}-21420 \,{\mathrm e}^{10 i \left (d x +c \right )}+10658 \,{\mathrm e}^{9 i \left (d x +c \right )}-21420 \,{\mathrm e}^{8 i \left (d x +c \right )}+5112 \,{\mathrm e}^{7 i \left (d x +c \right )}-14280 \,{\mathrm e}^{6 i \left (d x +c \right )}+4788 \,{\mathrm e}^{5 i \left (d x +c \right )}-5040 \,{\mathrm e}^{4 i \left (d x +c \right )}+840 \,{\mathrm e}^{3 i \left (d x +c \right )}-1260 \,{\mathrm e}^{2 i \left (d x +c \right )}+315 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{315 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{9}}-\frac {a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(240\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 116, normalized size = 0.77 \begin {gather*} -\frac {2520 \, a \log \left (\cos \left (d x + c\right )\right ) - \frac {2520 \, a \cos \left (d x + c\right )^{8} - 5040 \, a \cos \left (d x + c\right )^{7} - 3360 \, a \cos \left (d x + c\right )^{6} + 3780 \, a \cos \left (d x + c\right )^{5} + 3024 \, a \cos \left (d x + c\right )^{4} - 1680 \, a \cos \left (d x + c\right )^{3} - 1440 \, a \cos \left (d x + c\right )^{2} + 315 \, a \cos \left (d x + c\right ) + 280 \, a}{\cos \left (d x + c\right )^{9}}}{2520 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.70, size = 123, normalized size = 0.81 \begin {gather*} -\frac {2520 \, a \cos \left (d x + c\right )^{9} \log \left (-\cos \left (d x + c\right )\right ) - 2520 \, a \cos \left (d x + c\right )^{8} + 5040 \, a \cos \left (d x + c\right )^{7} + 3360 \, a \cos \left (d x + c\right )^{6} - 3780 \, a \cos \left (d x + c\right )^{5} - 3024 \, a \cos \left (d x + c\right )^{4} + 1680 \, a \cos \left (d x + c\right )^{3} + 1440 \, a \cos \left (d x + c\right )^{2} - 315 \, a \cos \left (d x + c\right ) - 280 \, a}{2520 \, d \cos \left (d x + c\right )^{9}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 2.34, size = 184, normalized size = 1.22 \begin {gather*} \begin {cases} \frac {a \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {a \tan ^{8}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{9 d} + \frac {a \tan ^{8}{\left (c + d x \right )}}{8 d} - \frac {8 a \tan ^{6}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{63 d} - \frac {a \tan ^{6}{\left (c + d x \right )}}{6 d} + \frac {16 a \tan ^{4}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{105 d} + \frac {a \tan ^{4}{\left (c + d x \right )}}{4 d} - \frac {64 a \tan ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}}{315 d} - \frac {a \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {128 a \sec {\left (c + d x \right )}}{315 d} & \text {for}\: d \neq 0 \\x \left (a \sec {\left (c \right )} + a\right ) \tan ^{9}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 293 vs.
\(2 (137) = 274\).
time = 6.00, size = 293, normalized size = 1.94 \begin {gather*} \frac {2520 \, a \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 2520 \, a \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {9177 \, a + \frac {87633 \, a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {375732 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {953988 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {1594782 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {1336734 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} + \frac {781956 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {302004 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} + \frac {69201 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}} + \frac {7129 \, a {\left (\cos \left (d x + c\right ) - 1\right )}^{9}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{9}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{9}}}{2520 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.13, size = 259, normalized size = 1.72 \begin {gather*} \frac {2\,a\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d}-\frac {2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}-18\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+\frac {218\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}}{3}-174\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\frac {1382\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{5}-\frac {2114\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{15}+\frac {1654\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{35}-\frac {326\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{35}+\frac {256\,a}{315}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{18}-9\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{16}+36\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}-84\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+126\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-126\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+84\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-36\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+9\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________